<template>
    <Modal
        v-model="firstLogin"
        class="pages-home-homeIndex-firstLogin"
        :mask-closable="false"
        :closable="false"
        @on-cancel="cancelModalBtn"
        class-name="vertical-center-modal">
        <div class="form-body">
            <h3>欢迎使用易撰,完善信息后开启您的高效创作之旅吧~</h3>
            <br>
            <p>请选择您最感兴趣的领域(可多选,至少选择一个哦)</p>
            <Checkbox-group v-model="disabledGroup" v-if="listObj">
                <Checkbox v-for="item in listObj" :label="item.MName"></Checkbox>
            </Checkbox-group>
            <div v-else style="text-align: center;margin-top: 10px;">加载中...</div>
            <br>
            <p>若以上领域没有您感兴趣的,可自定义添加,您的宝贵建议是我们前进的动力</p>
            <!--用户手动输入自己感兴趣的东西-->
            <div>

            </div>

        </div>
        <div slot="footer">
            <Button type="primary" @click="handleSubmit()">下一步</Button>
        </div>
    </Modal>
</template>

<script>

    import getData from '../../../api/getData'

    export default {
        props: [
            'firstLogin'
        ],
        data: function () {
            return{
                chargeModal : true,
                disabledGroup: [],
                listObj:null,

            }
        },
        created(){
            this.selectLists();
        },
        methods: {
            cancelModalBtn: function () {
                this.chargeModal = false;
                this.$emit("close-modal");
            },
            handleSubmit () {
                var self = this;
                getData.post("chargeBalance", {
//                    payType: self.formValidate.payWay,
//                    Monery: self.formValidate.amount
                }).then(function (response) {
                    self.$emit('close-modal')

                    if (response.data.code == 0) {
                        self.$Message.info(response.data.msg);
                        self.chargeModal = false;
//                        self.$emit('close-modal')

                    } else {
                        self.$Message.warning(response.data.msg ? response.data.msg : '网络错误，请稍后重试');
                    }

                }).catch(function (response) {
                    self.$Message.info('网络错误，请联系客服');
                });
            },
            selectLists:function () {
                var self = this;
                getData.get("getMeatilFirstLevelClass", {})
                    .then(function (response) {
                        if(response.data.code === 0){
                            self.listObj = response.data.data;
                            console.log(response.data.data)
                        }
                    })
                    .catch(function (response) {
                        console.log(response);
                    });
            }
        },
        components: {}
    }
</script>

<style lang="scss">
    .pages-home-homeIndex-firstLogin {

    .form-body {
        padding-left: 25px;
        padding-top: 10px;
    }

    .ivu-form-item {
        margin-bottom: 15px;
    }

    }
</style>
